import request from './../utils/request'

export default {
  // 获取所有会员列表
  getMemberList (currentPage, pageSize, query) {
    return request({
      url: `/member/list/search/${currentPage}/${pageSize}`,
      method: 'post',
      data: query
    })
  },
  // 新增会员
  addMember (formName) {
    return request({
      url: '/member',
      method: 'post',
      data: {
        formName
      }
    })
  },
  // 更新会员
  updateById (formName) {
    return request({
      url: `/member/${formName.id}`,
      method: 'put',
      data: formName
    })
  },
  getById (id) {
    return request({
      url: `/member/${id}`,
      method: 'get'
    })
  },
  // 删除会员
  deleteById (id) {
    return request({
      url: `/member/${id}`,
      method: 'delete'
    })
  }
}
